import time
def day():
    year=time.strftime('%Y')
    month=time.strftime('%-m')#加-不显示0
    day=time.strftime('%-d')
    if month=="1" and day=="1":
        cmd("mkdir "+year)
        cmd("mkdir "+year+"/"+month)
    elif day=="1":
        cmd("mkdir "+year+"/"+month)    
    day=year+"/"+month+"/"+day+".txt"
    return day
#print(day)
from subprocess import Popen, PIPE
def cmd(cmd):
    p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, stdin=PIPE)
    output = p.stdout.read()
    print(str(output, encoding='utf-8'))
    output = p.stderr.read()
    print(str(output, encoding='utf-8'))
    #return(str(p.stdout.read(), encoding='utf-8'))

#rexicmd("touch "+day+" && open "+day)


